![]() |
| Object Behaviour The behavior of an object is determined by it's operations. A method provides the implementation of an operation for certain objects. Different objects may have different methods for the same operation. This mechanism is called method overriding (see section on Overriding). When a request (message) is sent to an object, this object executes a certain method and maybe sends a message to another object. Messages are used for object interaction (see section on Objects) while methods are executed as reaction upon a message. For each message an object understands there is an appropriate method to execute. Methods often are the only interface to communicate with an object. Sometimes the attributes of an object can directly be manipulated. This depends on the kind of encapsulation a system provides (see section on Encapsulation). In some systems, methods must be provided to get or to set the values of attributes. These systems are realizing strong encapsulation.
Now go on to ...
|